package com.atguigu.srb.servicesms.config;


import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties(prefix = "aliyun.sms")
@Data
public class SmsProperties implements InitializingBean {
    private String host;// = "https://zwp.market.alicloudapi.com";
    private String path;// = "/sms/sendv2";
    private String method;// = "GET";
    private String appcode;// = "786c6a3f152848b7aaec252dc9288d98";

    public static String HOST;
    public static String PATH;
    public static String METHOD;
    public static String APPCODE;


    //对象初始化调用
    @Override
    public void afterPropertiesSet() throws Exception {
        SmsProperties.HOST=this.host;
        SmsProperties.PATH=this.path;
        SmsProperties.METHOD=this.method;
        SmsProperties.APPCODE=this.appcode;
    }
}
